<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      #div {
        width: 100px;
        height: 100px;
        background-color: aqua;
      }
    </style>
  </head>
  <body>
    <!-- <script src="./js/chushihua.js"></script> -->
    <button>显示隐藏</button>
    <hr />
    <div id="div"></div>
    <script>
      var div = $('#div')
      var btn = $('button')
      // var btn = document.getElementsByTagName(button)

      var flag = true
      btn.onclick = function () {
        if (flag) {
          div.style.display = 'none'
          flag = false
        } else {
          div.style.display = 'block'
          flag = true
        }
      }
    </script>
  </body>
</html>
